﻿@model LanguageFeatures.Models.Product

@{
    ViewBag.Title = "DemoExpression";
    Layout = "~/Views/_BasicLayout.cshtml";
}

<table>
    <thead>
        <tr>
            <th>Property</th>
            <th>Value</th>
        </tr>
    </thead>
    <tbody>
        <tr>
            <td>Name</td>
            <td>@Model.Name</td>
        </tr>
        <tr>
            <td>Price</td>
            <td>@Model.Price</td>
        </tr>
        <tr>
            <td>Stock Level</td>
            <td>
                @if (ViewBag.ProductCount == 0)
                {
                    @: Out of Stock
                }
                else if (ViewBag.ProductCount == 1)
                {
                    <b>Low Stock (@ViewBag.ProductCount)</b>
                }
                else
                {
                    @ViewBag.ProductCount
                }
            </td>
        </tr>
    </tbody>
</table>
<div data-discount="@ViewBag.ApplyDiscount" data-express="@ViewBag.ExpressShip"
     data-supplier="@ViewBag.Supplier">
    The containing element has data attribute
</div>
Discount:<input type="checkbox" checked="@ViewBag.ApplyDiscount"/>
Express:<input type="checkbox" checked="@ViewBag.ExpressShip"/>
Supplier: <input type="checkbox" checked="@ViewBag.Supplier"/>